<template>
  <ShopInfo :id="id" :audit="audit" :readonly="readonly"/>
</template>

<script lang="ts" setup>
import { useRoute } from 'vue-router';
import { computed } from 'vue';
import ShopInfo from './components/shop-info.vue'

defineOptions({name: 'shop-operation'});

const route = useRoute();
const id = computed(() => {
  const {id} = route.params;
  return parseInt(!Array.isArray(id) ? id : '0');
});

const audit = computed(() => {
  const {type} = route.params;
  return 'audit' == type;
});

const readonly = computed(() => {
  const {type} = route.params;
  return 'info' == type || 'audit' == type;
});
</script>

<style lang="scss" scoped>

</style>
